package com.codedancer.campus.client.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.codedancer.campus.client.service.ICommentReportTypeService;
import com.codedancer.campus.client.service.vo.commentReport.CommentReportTypeVo;
import com.codedancer.campus.mapper.CommentReportTypeMapper;
import com.codedancer.campus.po.CommentReportType;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class CommentReportTypeServiceImpl implements ICommentReportTypeService {

  @Autowired
  private CommentReportTypeMapper commentReportTypeMapper;

  /**
   * 获取全部评论举报类型
   *
   * @return
   */
  @Override
  public List<CommentReportTypeVo> list() {
    List<CommentReportType> commentReportTypes = commentReportTypeMapper.selectList(null);
    return BeanUtil.copyToList(commentReportTypes, CommentReportTypeVo.class);
  }
}
